gtk: Stop using gtk_device_get_surface_at_position
authorMatthias Clasen <mclasen@redhat.com>
Tue, 26 Mar 2019 00:37:13 +0000 (20:37 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 26 Mar 2019 22:12:55 +0000 (18:12 -0400)
We should always use the double variant of the api.

demos/gtk-demo/changedisplay.c
gtk/gtktooltip.c
gtk/inspector/inspect-button.c

index 5f5717c43d854affc5d9100b4d6bcfae58229645..0a963fe15723abe6775cc8415ad9f500a5fee77f 100644 (file)
@@ -71,7 +71,7 @@ find_toplevel_at_pointer (GdkDisplay *display)
   GdkSurface *pointer_window;
   GtkWidget *widget = NULL;
 
-  pointer_window = gdk_device_get_surface_at_position (gtk_get_current_event_device (), NULL, NULL);
+  pointer_window = gdk_device_get_surface_at_position_double (gtk_get_current_event_device (), NULL, NULL);
 
   if (pointer_window)
     widget = GTK_WIDGET (gtk_root_get_for_surface (pointer_window));
index e5992529e229df082ca2a06f690935a23b3a343e..9de95a6d3ded8913f8060ce8b748f382e7eee0d3 100644 (file)
@@ -382,7 +382,7 @@ void
 gtk_tooltip_trigger_tooltip_query (GtkWidget *widget)
 {
   GdkDisplay *display;
-  gint x, y;
+  double x, y;
   GdkSurface *surface;
   GdkDevice *device;
   GtkWidget *toplevel;
@@ -394,7 +394,7 @@ gtk_tooltip_trigger_tooltip_query (GtkWidget *widget)
 
   /* Trigger logic as if the mouse moved */
   device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
-  surface = gdk_device_get_surface_at_position (device, &x, &y);
+  surface = gdk_device_get_surface_at_position_double (device, &x, &y);
   if (!surface)
     return;
 
@@ -403,7 +403,7 @@ gtk_tooltip_trigger_tooltip_query (GtkWidget *widget)
   if (gtk_widget_get_surface (toplevel) != surface)
     return;
 
-  gtk_widget_translate_coordinates (toplevel, widget, x, y, &dx, &dy);
+  gtk_widget_translate_coordinates (toplevel, widget, round (x), round (y), &dx, &dy);
 
   gtk_tooltip_handle_event_internal (GDK_MOTION_NOTIFY, surface, widget, dx, dy);
 }
index 76e52f4df1cd66319206e9b62cfead483bf53c30..83867b8b8d8203d4ef7e3900c3f199d1e217cec6 100644 (file)
@@ -43,7 +43,7 @@ find_widget_at_pointer (GdkDevice *device)
   GtkWidget *widget = NULL;
   GdkSurface *pointer_surface;
 
-  pointer_surface = gdk_device_get_surface_at_position (device, NULL, NULL);
+  pointer_surface = gdk_device_get_surface_at_position_double (device, NULL, NULL);
 
   if (pointer_surface)
     widget = gtk_root_get_for_surface (pointer_surface);